﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Digitalmes.Models
{
    #region 辅助类


    /// <summary>
    /// 客户端信息
    /// </summary>
    public class ClientInfo
    {
        public string ClientId { get; set; }
        public DateTime ConnectedTime { get; set; }
        public DateTime LastActivity { get; set; }
        public long MessagesSent { get; set; }
    }

    /// <summary>
    /// MQTT消息
    /// </summary>
    public class MqttMessage
    {
        public string ClientId { get; set; }
        public string Topic { get; set; }
        public string Payload { get; set; }
        public DateTime Timestamp { get; set; }
        public MQTTnet.Protocol.MqttQualityOfServiceLevel Qos { get; set; }
    }

    /// <summary>
    /// 传感器数据
    /// </summary>
    public class SensorData
    {
        public string Type { get; set; }
        public double Value { get; set; }
        public string Unit { get; set; }
        public DateTime Timestamp { get; set; }
    }

    /// <summary>
    /// 服务器统计信息
    /// </summary>
    public class MqttServerStats
    {
        public int ConnectedClients { get; set; }
        public int TotalMessagesStored { get; set; }
        public int TopicsCount { get; set; }
        public TimeSpan Uptime { get; set; }
        public List<ClientInfo> ClientDetails { get; set; }
    }

    #endregion
}
